//
//  JYTLianView.m
//  JYT_IOS
//
//  Created by nxa-tankeke on 17/1/10.
//  Copyright © 2017年 nxa-yuanguoxiang. All rights reserved.
//

#import "JYTLianView.h"
#import "JYTAppointModel.h"
#import <UIImageView+WebCache.h>

@implementation JYTLianView

+ (instancetype)jiaolian
{
    
     return [[[NSBundle mainBundle] loadNibNamed:NSStringFromClass(self) owner:nil options:nil] lastObject];
    
}

-(void)setAppointModel:(JYTAppointModel *)appointModel
{
    _appointModel = appointModel;
 
    NSString *starLevel = appointModel.grade_value;
    if ([starLevel isEqualToString:@"1"]) {
        [self.oneLevel setHidden:YES];
        
    } else if([starLevel isEqualToString:@"2"]) {
        [self.oneLevel setHidden:YES];
        [self.twoLevel setHidden:YES];
        
    } else if([starLevel isEqualToString:@"3"]) {
        [self.oneLevel setHidden:YES];
        [self.twoLevel setHidden:YES];
        [self.threeLevel setHidden:YES];
        
    } else if([starLevel isEqualToString:@"4"]) {
        [self.oneLevel setHidden:YES];
        [self.twoLevel setHidden:YES];
        [self.threeLevel setHidden:YES];
        [self.fourLevel setHidden:YES];
        
    } else if([starLevel isEqualToString:@"5"]) {
        [self.oneLevel setHidden:YES];
        [self.twoLevel setHidden:YES];
        [self.threeLevel setHidden:YES];
        [self.fourLevel setHidden:YES];
        [self.fiveLevel setHidden:YES];
    }

   
    NSString *imgURL = appointModel.Url;
    if (imgURL) {
        [self.headerImageView sd_setImageWithURL:[NSURL URLWithString:imgURL] placeholderImage:[UIImage imageNamed:@"教练"]];
    } else {
        [self.headerImageView setImage:[UIImage imageNamed:@"教练"]];
    }
    
    
    
}
@end
